package router

import (
	"gin-vue-admin/api/v1"
	"gin-vue-admin/api/view_api"
	"gin-vue-admin/middleware"
	"github.com/gin-gonic/gin"
)

func InitUserOrderRouter(Router *gin.RouterGroup) {
	UserOrderRouter := Router.Group("userOrder").Use(middleware.OperationRecord())
	{
		UserOrderRouter.POST("createUserOrder", v1.CreateUserOrder)   // 新建UserOrder
		UserOrderRouter.DELETE("deleteUserOrder", v1.DeleteUserOrder) // 删除UserOrder
		UserOrderRouter.DELETE("deleteUserOrderByIds", v1.DeleteUserOrderByIds) // 批量删除UserOrder
		UserOrderRouter.PUT("updateUserOrder", v1.UpdateUserOrder)    // 更新UserOrder
		UserOrderRouter.GET("findUserOrder", v1.FindUserOrder)        // 根据ID获取UserOrder
		UserOrderRouter.GET("getUserOrderList", v1.GetUserOrderList)  // 获取UserOrder列表
	}
}

func InitUserOrderRouterPublic(Router *gin.RouterGroup){
	userORderRouterPublic := Router.Group(`view_api/user_order`)
	{
		userORderRouterPublic.GET("orders",view_api.GetOrderById)
		userORderRouterPublic.GET(`list`,view_api.GetUserOrderList)
		userORderRouterPublic.POST(`createOrder`,view_api.CreateUserOrder)
		userORderRouterPublic.POST(`UpdateOrder`,view_api.UpdateUserOrder)
		userORderRouterPublic.POST("updateOrderDetail",view_api.UpdateUserOrderDetail)
		userORderRouterPublic.GET("userOrderDetailList",view_api.UserOrderDetailList)
	}
}


